<template>
  <div class="search">
    <f-form ref="form" :action="api.payinfo" :form-key="this.formItem.payInfoId" >
      <f-form-item label=""  name="accountId" dataType="${formField.dataType}"   :value="formItem.accountId" />
      <f-form-item label="订单号"  name="orderNo" dataType="${formField.dataType}"   :value="formItem.orderNo" />
      <f-form-item label="商品描述"  name="subject" dataType="${formField.dataType}"   :value="formItem.subject" />
      <f-form-item label="商品标题"  name="body" dataType="${formField.dataType}"   :value="formItem.body" />
      <f-form-item label="数量（商品数量）"  name="count" dataType="number"   :value="formItem.count" />
      <f-form-item label=""  name="carriage" dataType="${formField.dataType}"   :value="formItem.carriage" />
      <f-form-item label="商品总价"  name="amount" dataType="${formField.dataType}"   :value="formItem.amount" />
      <f-form-item label="订单类型（1购买产品 , 2 转卡费用）"  name="busType" dataType="${formField.dataType}"   :value="formItem.busType" />
      <f-form-item label="支付类型（PAY_ALI支付宝 , PAY_WX微信,PAY_UNDERLINE线下支付）"  name="payType" dataType="${formField.dataType}"   :value="formItem.payType" />
      <f-form-item label="支付状态（PAY_0未支付 ,PAY_1已支付,PAY_2已退款）"  name="payStatus" dataType="${formField.dataType}"   :value="formItem.payStatus" />
      <f-form-item label="渠道订单号"  name="channelOrderNum" dataType="${formField.dataType}"   :value="formItem.channelOrderNum" />
      <f-form-item label="订单Id"  name="targetId" dataType="${formField.dataType}"   :value="formItem.targetId" />
      <f-form-item label="付款日期"  name="payDate" dataType="${formField.dataType}"   :value="formItem.payDate" />
      <f-form-item label="完成日期"  name="finishDate" dataType="${formField.dataType}"   :value="formItem.finishDate" />
      <f-form-item label="最后修改时间"  name="modifyDate" dataType="${formField.dataType}"   :value="formItem.modifyDate" />
      <f-form-item label="创建日期"  name="createDate" dataType="${formField.dataType}"   :value="formItem.createDate" />
      <f-form-item label="支付参数"  name="payparamId" dataType="${formField.dataType}"   :value="formItem.payparamId" />
      <f-form-item label="备注"  name="remark" dataType="${formField.dataType}"   :value="formItem.remark" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'payinfoForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          payInfoId: '',
          accountId: '',
          orderNo: '',
          subject: '',
          body: '',
          count: '',
          carriage: '',
          amount: '',
          busType: '',
          payType: '',
          payStatus: '',
          channelOrderNum: '',
          targetId: '',
          payDate: '',
          finishDate: '',
          modifyDate: '',
          createDate: '',
          payparamId: '',
          remark: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.payInfoId) {
          let params={
              payInfoId:data.payInfoId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
